-
Notifications
You must be signed in to change notification settings - Fork 748
Persistent notifications to repairs and fix free_space check #6179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Let's remove it once #6148 is merged.
At the time of writing, the x86-64 extracted image size (without layer sharing) 3.12GB, the layer sizes 651MB. In worst case, both are at the disk at the same time, so ideally we'd make sure that 4GB is available for a full Core update without any layer sharing. But with layer sharing, and unpacking while downloading we probably get away with quite a bit less. In a quick test on aarch64 an update from 2025.9.1 to 2025.9.3 with 1.9GB disk space free worked. Looking at the image manifests shows that 112MB is shared, the rest is not shared (~547MB), so I'd expect that more than 2GB is required even in a good case 🤔 🤷 . Maybe Docker automatically does layer by layer in case storage gets tight 🤔 . In the end, it's a bit a tradeoff preventing users from starting an update which anyway doesn't work, and being overly cautions. Since we have better error handling now, folks will learn when the update doesn't complete due to space issues. I think going with 2GB for now is fine. |
agners
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup, LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates from persistent notifications to the repairs system for most supervisor issues, with the exception of one legacy security issue. The PR also updates the free space check to use a higher threshold and removes suggestions to delete full backups.
- Removes persistent notification generation for most issue types (free space, pwned passwords) in favor of repairs
- Updates free space threshold from 1GB to 2GB and simplifies the check logic
- Retains persistent notification only for the security issue affecting Home Assistant versions below 2021.1.5
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| supervisor/resolution/notify.py | Removes most notification logic, keeps only legacy security notification |
| supervisor/resolution/const.py | Increases minimum free space threshold from 1GB to 2GB |
| supervisor/resolution/checks/free_space.py | Simplifies free space check by removing backup deletion suggestions |
| tests/resolution/check/test_check_free_space.py | Updates tests to reflect simplified free space logic |
| tests/resolution/check/test_check.py | Updates disk usage mock values for new 2GB threshold |
| tests/jobs/test_job_decorator.py | Updates disk usage mock values for new threshold |
| tests/store/test_store_manager.py | Updates disk usage mock values for new threshold |
Proposed change
Supervisor continues to make persistent notifications rather then repairs for a small subset of issues. This no longer makes sense so remove this and make proper repairs for any we can.
The one exception is the security one targeted at people using custom components with Home Assistant <2021.1.5 because I don't think repairs existed then. Although I wonder if we really have to continue to leave this one around at this point? It's quite old.
In addition I changed the free space issue to stop suggesting to remove a full backup and bumped its lower limit to 2GB. I'm not sure if 2GB is enough either but its better then 1GB. And the "remove full backup" suggestion was always pretty odd and kind of the reason we didn't make this one into a repair already, people didn't like that. The repair will just link to our clear up storage guide
Type of change
Additional information
Checklist
ruff format supervisor tests)If API endpoints or add-on configuration are added/changed: